package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsQuoterExpressChangePageUtil extends SeleniumPageUtil {
	public final static By CQD_TD_TITLE = By.xpath("//*[@id='Quoter_QuoteList1_pnlPage']/table/tbody/tr/td[4]");
	public final static By CQD_SPAN_TITLE = By.id("Quoter_QuoteList1_lblScope");
	public final static By CQD_TD_CONTRACT_ID = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[1]");
	public final static By CQD_TD_REVISION = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[2]");
	public final static By CQD_TD_SUBVER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[3]");
	public final static By CQD_TD_EX_CREATE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[4]");
	public final static By CQD_TD_EX_BY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[5]");
	public final static By CQD_TD_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[6]");
	public final static By CQD_TD_TYPE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[7]");
	public final static By CQD_TD_END_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]");
	public final static By CQD_TD_CREATEBY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[9]");
	public final static By CQD_TD_CREATE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[10]");
	public final static By CQD_TD_SALESREP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[11]");
	public final static By CQD_TD_ROUGH_MMC = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[12]");
	public final static By CQD_TD_LINES = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[13]");
	public final static By CQD_TD_DISCREPS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[14]");
	public final static By CQD_TD_ERRORS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[15]");
	public final static By CQD_TD_WARNINGS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[16]");
	public final static By CQD_TD_CONFIG = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[17]");
	
	public static void enter(){
		SpContractsQuoterPageUtil.enter();
		SpContractsQuoterPageUtil.displayHidenMenus(new By[]{SpContractsQuoterPageUtil.STQ_LINK_DASH});
		SeleniumUtil.waitOnElements(new By[]{SpContractsQuoterPageUtil.STQ_LINK_DASH_EXPRESS});
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpContractsQuoterPageUtil.STQ_LINK_DASH_EXPRESS));
		SeleniumUtil.waitForFixedMilliseconds(1000);
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CQD_TD_TITLE,CQD_TD_CONFIG
		});
	}
}
